var crypto = require('crypto');

var hash = crypto.createHash('md5');
hash.update(new Buffer('123456', 'binary'));
var encode1 = hash.digest('hex');
console.log(encode1);

var hash = crypto.createHash('md5');
hash.update(new Buffer('123456'));
var encode2 = hash.digest('hex');
console.log(encode2);

var sha1 = crypto.createHash('sha1');
sha1.update(new Buffer('123456'));
var encode3 = sha1.digest('hex');
console.log(encode3);

var hmac = crypto.createHmac('md5','dan');
hmac.update(new Buffer('123456','binary'));
var encode4 = hmac.digest('hex');
console.info(encode4);
